package com.jt.www.admin.market.service;

import com.jt.www.domain.enums.common.YesOrNoEnum;
import com.jt.www.domain.po.TeamEntity;
import com.jt.www.domain.po.TeamFounderEntity;
import com.jt.www.domain.qo.SaveTeamMembersQO;
import com.jt.www.domain.qo.TeamFounderExportQO;
import com.jt.www.domain.qo.TeamFounderInfoQO;
import com.jt.www.domain.vo.*;
import com.jt.www.model.reps.GenericDataResponse;
import com.jt.www.model.reps.GenericListResponse;
import org.springframework.http.ResponseEntity;

import java.util.List;

public interface TeamService {

    /**
     * 团队创始人配置
     *
     * @param findCode
     * @param teamFounderEntity
     * @return
     */
    ResponseEntity saveTeamFounder(String findCode, TeamFounderEntity teamFounderEntity);

    /**
     * 团队成员配置
     *
     * @param findCode
     * @param saveTeamMembersQO
     * @return
     */
    ResponseEntity saveTeamMembers(String findCode, SaveTeamMembersQO saveTeamMembersQO);

    /**
     * 根据创始人ID查询小队列表
     *
     * @param findCode
     * @param teamFounderId
     * @return
     */
    ResponseEntity<GenericListResponse<TeamEntity>> queryTeams(String findCode, String teamFounderId);

    /**
     * 根据创始人ID查询未分组成员列表
     *
     * @param findCode
     * @param teamFounderId
     * @param memberId
     * @return
     */
    ResponseEntity<GenericListResponse<TeamMembersVO>> queryNoTeamMembersByFounderId(String findCode, Long teamFounderId, Long memberId);

    /**
     * 成员进/出队
     *
     * @param findCode
     * @param memberId
     * @param teamId
     * @param levelCode
     * @param newTeamId
     * @param memberIds
     * @return
     */
    ResponseEntity updateTeamMember(String findCode, Long memberId, Long teamId, String levelCode,
                                    Long newTeamId, String memberIds);

    /**
     * 成员移除
     *
     * @param findCode
     * @param memberId
     * @return
     */
    ResponseEntity removeTeamMember(String findCode, String memberId);

    /**
     * 成员重置
     *
     * @param findCode
     * @param teamFounderId
     * @return
     */
    ResponseEntity resetTeamMembers(String findCode, String teamFounderId);

    /**
     * 根据创始人ID查询团队详细信息
     *
     * @param findCode
     * @param teamFounderId
     * @return
     */
    ResponseEntity<GenericDataResponse<TeamDetailVO>> queryDetailByTeamFounderId(String findCode, Long teamFounderId);

    /**
     * 根据小队ID查询小队业务员信息列表
     *
     * @param findCode
     * @param teamId
     * @return
     */
    ResponseEntity queryMembersByTeamId(String findCode, Long teamId);

    /**
     * 解散创始人团队
     *
     * @param findCode
     * @param teamFounderId
     * @return
     */
    ResponseEntity disbandTeamFounder(String findCode, Long teamFounderId);

    /**
     * 分页查询创始人信息
     *
     * @param findCode
     * @param teamFounderInfoQO
     * @return
     */
    ResponseEntity queryTeamFounders(String findCode, TeamFounderInfoQO teamFounderInfoQO);

    /**
     * 导出创始人信息
     *
     * @param findCode
     * @param teamFounderExportQO
     * @return
     */
    List<TeamFounderInfoVO> exportTeamFounders(String findCode, TeamFounderExportQO teamFounderExportQO);

    /**
     * 通过营销员员工编号查询小队相关信息
     *
     * @param marketerNo
     * @param allHistory 是否查询所有历史记录，Y是 N否
     * @return
     */
    List<CommissionTeamVO> queryTeamByMarketerNo(String marketerNo, YesOrNoEnum allHistory);

    /**
     * 通过分支机构查询有效创始人列表
     *
     * @param branchCode 分支机构
     * @return
     */
    List<FounderVo> queryTeamFoundersByBranchCode(String branchCode);
}
